package com.yuanfud.blog.service;

import com.yuanfud.blog.VO.NewsVO;
import com.yuanfud.common.exception.RestException;
import com.yuanfud.entity.blog.ArticleList;
import com.yuanfud.entity.common.MasterPage;
import com.yuanfud.entity.common.PageInfoModel;

import java.util.List;
import java.util.Map;

public interface NewsService {
    PageInfoModel<ArticleList> getNewsInfo(MasterPage page) throws RestException;

    ArticleList getNewsById(int id) throws RestException;
    /**
     * 根据ID获取对应类别名称
     * @param id 类别ID
     * @return
     * @throws RestException
     */
    String getNewsType(Integer id) throws RestException;

    /**
     * 获取类别列表
     * @param fatherId  父类ID
     * @return
     * @throws RestException
     */
    List<Map<Integer,String>> getNewsTypeList(Integer fatherId) throws RestException;

    boolean addNewsInfo(NewsVO news) throws RestException;

    boolean delArticle(int id) throws RestException;

    boolean ArticleEdit(NewsVO news) throws RestException;
}
